import { DatePicker } from 'antd';
import React from 'react';
import dayjs from 'dayjs';
import { getInitDate } from './utils';

const DatePickerCom = (porps) => {
  const { value } = porps;
  const initDate = value || getInitDate();
  const onChange = (time, timeString) => {
    console.log(time, timeString);
  };
  return (
    <>
      <DatePicker onChange={onChange} placeholder="请选择开始日期" defaultValue={dayjs(initDate[0])} />
      <DatePicker onChange={onChange} placeholder="请选择结束日期" defaultValue={dayjs(initDate[1])} />
    </>
  );
};
export default DatePickerCom;
